﻿<%@ Page Language="C#" MasterPageFile="~/MembersHome/MembersHome.Master" AutoEventWireup="true"
    CodeBehind="publish.aspx.cs" Inherits="TCS.Web.MembersHome.publish" Title="发布" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script src="../My97DatePicker/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/jquery-1.1.3.1.pack.js"></script>
    <script type="text/javascript" src="../js/thickbox-compressed.js"></script>  
    <link href="../css/thickbox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" >
        function disPlayDIV() {

            if (document.getElementById("EditDiv").style.display == "none") {
                document.getElementById("EditDiv").style.display = "block";
                document.getElementById("EditDiv1").style.display = "none";
            } else {

                document.getElementById("EditDiv").style.display = "none";
                document.getElementById("EditDiv1").style.display = "block";
            }
            if (document.getElementById("EditDiv1").style.display == "none") {
                var aa = WebForm3.ModifyWaitInfo(result, id);
            }
        }
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <script type="text/javascript">
  function SelectAll(tempControl)
  {
  //将除头模板中的其它所有的CheckBox取反  
  var theBox=tempControl;
  xState=theBox.checked;   
  elem=theBox.form.elements;
  for(i=0;i<elem.length;i++)
  if(elem[i].type=="checkbox" && elem[i].id!=theBox.id)
  {
  if(elem[i].checked!=xState)
   elem[i].click();
  }
  }   
  </script>
<%--<script type="text/javascript" language="javascript" >
    window.onload = function ()
    {
	    var btnPublish = document.getElementById('<%=this.btnPublish.ClientID %>');
	    var oBox = document.getElementById('<%=this.txtText.ClientID %>');
	    var timer = null;	
	    btnPublish.onclick = function ()
	    {		
		    var i = 0;	
		    clearInterval(timer);
		    timer = setInterval(function () {
			    oBox.style.display = i++ % 2 ? "none" : "block";
			    i > 6 && (clearInterval(timer))
		    }, 80)
	    }
    };
</script>--%>
    <script type="text/javascript" src="/js/j.js"></script>
    
  <script type="text/javascript">
//        $(function() {
//            $("input").click(function() {
//                var val = $("textarea").val();
//                if (val === "") {
//                    $("textarea").css({ background: "#f00", opacity: 0 }).animate({ opacity: 1 }, 200);
//                    $("textarea").animate({ opacity: 0 }, 200);
//                    $("textarea").animate({ opacity: 1 }, 200);
//                    $("textarea").animate({ opacity: 0 }, 200, function() {
//                        $("textarea").css({ background: "none", opacity: 1 });
//                    });
//                }
//            });
//        });
    </script>

    <script src="/js/CheckBox.js" type="text/javascript"></script>

    <script src="/js/jquery.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        var num = 140;
        var pd = 0;
        String.prototype.len = function() {
            return this.replace(/[^\x00-\xff]/g, "**").length; //将中文认为是两个字，返回2
        }
        function fx(obj) {
            var ts = document.getElementById('tishi');
            var str = obj.value;
            var n = Math.ceil(str.len() / 2); //调用方法
            pd = num - n;
            if ((num - n) >= 0) {
                document.getElementById('<%=this.btnPublish.ClientID %>').disabled = false;
                ts.innerHTML = '您还可以输入' + (num - n) + '个字';
            } else {
                document.getElementById('<%=this.btnPublish.ClientID %>').disabled = true;
                ts.innerHTML = '<font color="red">您已经超出' + (n - num) + '个字</font>';
            }
        }
        /*********-设置按钮不可用--*****/
        function setdisabled() {
            var b = new Object();
            b = document.getElementById('<%=this.btnPublish.ClientID %>');
            alert("No");
            b.disabled = !(b.disabled && true);
        }
        /*********-设置按钮可用--*****/
        function setabled() {
            var b = new Object();
            b = document.getElementById('<%=this.btnPublish.ClientID %>');
            alert("OK");
            b.disabled == (b.disabled && false);
        }
        function ti() {
            var c = document.getElementByIdx_x('<%=this.txtText.ClientID %>');
            var i = 1;
            if (pd <= 0 || c.value == '') {
                var t = setInterval(function() {
                    i++;
                    if (c.style.background == 'pink') {
                        c.style.background = 'white';
                    } else {
                        c.style.background = 'pink';
                    }
                    if (i > 4) {
                        clearInterval(t);
                    }
                }, 200)
            } else {
                document.form.submit();
            }

        }
        function biaoqing(id) {
            var oTextarea = document.getElementById('<%=this.txtText.ClientID %>').value;
            document.getElementById('<%=this.txtText.ClientID %>').value = oTextarea + id;
            //    document.getElementById('w_class1_con').style.display="none";
        }
    </script>

<SCRIPT language="javascript" type="text/javascript">
//    $(document).ready(function() {
//        new PopupLayer({ trigger: "#w_class1", popupBlk: "#w_class1_con", closeBtn: "#close1" });
//        new PopupLayer({ trigger: "#w_class2", popupBlk: "#w_class2_con", closeBtn: "#close2" });
//        new PopupLayer({ trigger: "#w_class3", popupBlk: "#w_class3_con", closeBtn: "#close3" });
//        new PopupLayer({ trigger: "#w_class4", popupBlk: "#w_class4_con", closeBtn: "#close4" });
//    });
</SCRIPT>

    <script src="../js/Trends.js" type="text/javascript"></script>
    <h2 class="content_title">
        微博发布</h2> 

    <div class="write_weibo l">
        <div class="time_if">
        	    <p> <asp:RadioButton ID="rdoPublic" runat="server" GroupName="public" 
                        Checked="True" /><label>立即发布</label></p>
                <p><asp:RadioButton ID="rdoSetSendTime" runat="server" GroupName="public" /><label>定时发送</label></p>
             <p> <asp:TextBox ID="txtSendDate" CssClass="time" onFocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" runat="server"></asp:TextBox><span>时间：</span></p>
        </div>
        <div class="textarea">
            <textarea class="w_area" id="txtText" onkeyup="fx(this)" runat="server"></textarea>
            <ul class="w_class">
                <li class="w_class1">
                    <div id="w_class1">
                        表情</div>
                    <div id="w_class1_con" style="display: none;" class="opp_tip_auto">
                        <div class="title">
                            <a class="r exit" id="close1" href="javascript:void(0)">关闭</a>
                            <ul class="mytab" id="myTab">
                                <li onclick="nTabs(this,0);" class="curr ">心情</li>
                                <li onclick="nTabs(this,1);">休闲</li>
                                <li onclick="nTabs(this,2);">搞怪</li>
                                <li onclick="nTabs(this,3);">管不着</li>
                                <li onclick="nTabs(this,4);">悠嘻猴</li>
                                <li onclick="nTabs(this,5);">哈皮兔</li>
                                <li onclick="nTabs(this,6);">小新小浪</li>
                            </ul>
                            <div class="mytab_con" id="myTab_Content0">
                                <asp:Repeater ID="Repeater1" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content1">
                                <asp:Repeater ID="Repeater2" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content2">
                                <asp:Repeater ID="Repeater3" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content3">
                                <asp:Repeater ID="Repeater4" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content4">
                                <asp:Repeater ID="Repeater5" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content5">
                                <asp:Repeater ID="Repeater6" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="mytab_con none" id="myTab_Content6">
                                <asp:Repeater ID="Repeater7" runat="server">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="#" onclick="biaoqing('<%# Eval("phrase")%>')">
                                            <img src='<%# Eval("url") %>' alt='<%# Eval("phrase")%>' style="border: 0" /></a>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>
                </li>
            
                
                  <li class="w_class2">
                    <asp:HiddenField ID="hidValue" runat="server" Value="" />
						<div id="w_class2">  <a href="UploadPic.aspx?keepThis=true&amp;TB_iframe=true&amp;height=250&amp;width=400" title="图片" class="thickbox">图片</a></div>
						<div id="w_class2_con" style="display:none;" class="opp_tip">
							<div class="title"><a class="r exit" id="close2" href="javascript:void(0)">关闭</a> 选picUpdlad择图片</div>
							<div class="link_upload">
								<p>  <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>文字提示</p>
								<p>
								 <asp:FileUpload ID="fileUpload1" runat="server" width="240"/>
                                    <asp:Button ID="Button1" runat="server" Text="图片上传server" onclick="Button1_Click" />   <input id="Button2" type="button" value="图片上传" onclick="javascript:picUpdlad()" />
								 </p>
                                
							</div>
						</div>
				</li>
                <li class="w_class3">
                    <div id="w_class3">
                        视频</div>
                    <div id="w_class3_con" style="display: none;" class="opp_tip">
                        <div class="title">
                            <a class="r exit" id="close3" href="javascript:void(0)">关闭</a>添加视频地址</div>
                        <div class="link_upload">
                            <p>
                                添加视频地址</p>
                            <p>
                                <input type="text" class="text" /><input type="button" class="btn" /></p>
                            <p>
                                或者上传视频</p>
                            <p>
                                <input class="input" type="file" style="border: 1px solid #000; background: none;" /></p>
                        </div>
                    </div>
                </li>
                <li class="w_class4">
                    <div id="w_class4">
                        链接</div>
                    <div id="w_class4_con" style="display: none;" class="opp_tip">
                        <div class="title">
                            <a class="r exit" id="close4" href="javascript:void(0)">关闭</a>添加链接地址</div>
                        <div class="link_upload">
                            <p>
                                添加地址</p>
                            <p>
                                <input type="text" class="text" /><input type="button" class="btn" /></p>
                        </div>
                    </div>
                </li>
                <li class="w_class5"><a href="#" onclick="inTopic('<%=this.txtText.ClientID %>','请在这里输入自定义话题')">
                    话题</a></li>
            </ul>
        </div>
        <div class="tip">
            <p>
                <asp:Button ID="btnPublish" runat="server" CssClass="fb_btn" OnClick="btnPublish_Click" /></p>
            <p>
                <span id="tishi">还能输入140字</span></p>
        </div>
    </div>
    <div class="weibo_rili r">
        <h3 class="weibo_rili_title">
            微博待发日历</h3>
        <div class="rili_con">
            <img src="images/irli.jpg" />
        </div>
    </div>
    <h4 class="search_if_title">
        待发微博查询条件</h4>
    <div class="search_if">
        <span>计划发布时间：</span> <span>
            <asp:TextBox ID="txtStartDate" CssClass="Wdate" runat="server" onClick="WdatePicker()"></asp:TextBox></span>
        <span>至</span> <span>
            <asp:TextBox ID="txtEndDate" CssClass="Wdate" runat="server" onClick="WdatePicker()"></asp:TextBox></span>
        <span>关键字</span> <span>
            <asp:TextBox ID="txtKeyWord" CssClass="inputCss" runat="server"></asp:TextBox></span>
        <span>
            <asp:ImageButton ID="ImgSearch" runat="server" ImageUrl="~/MembersHome/images/search_btn.jpg"
                OnClick="ImgSearch_Click" />
        </span>
    </div>
    
    <div class="checkbox_con">
        <span>
            <asp:CheckBox  class="check_all" ID="cbHeader" runat="server" Text="" 
            onclick="javascript:SelectAll(this);"  /><label>全选</label></span>
        <span>
            <asp:Button ID="btnDelete" runat="server" class="del_all" Text="批量删除" 
            onclick="btnDelete_Click" /></span>
                                <asp:FileUpload ID="fileUpload" runat="server" width="240"/>
								  <asp:Button ID="btnUp" runat="server" Text="上传2" 
                                        OnClick="btnUp_Click"     />
        11</div>
    <div class="search_con_list">
        <ul>
            <asp:Repeater ID="rptWaitInfo" runat="server" OnItemDataBound="rptWaitInfo_ItemDataBound"
                OnItemCommand="rptWaitInfo_ItemCommand">
                <HeaderTemplate>
                </HeaderTemplate>
                <ItemTemplate>
                    <li><span class="check_b">
                      <asp:CheckBox ID="chkItem" runat="server"/>
                             <input id="hfID" runat="server" type="hidden" value='<%# Eval("id")%>' />
                    </span>
                        <div class="search_b_con">
                            <div style="display:block" id="EditDiv">
                                <p class="weibo_con">
                                    <%#Eval("Content")%><img height="150" width="120" src='/ImgUpload/<%#Eval("Picture")%>' /></p>
                                <p class="time_op">
                                    <span class="time l">
                                        <%#Eval("CreateDate")%></span> <span class="op r">
                                            <a href="#" class="edit" onclick="disPlayDIV()">编辑</a>
                                          <!--  <asp:HyperLink ID="HyperLink1" runat="server" class="edit" >编辑</asp:HyperLink>-->
                                            <asp:LinkButton ID="linkDelete" CommandName="linkDelete" runat="server" class="del"
                                                CommandArgument='<%#Eval("ID")%>'>删除</asp:LinkButton>
                                        </span>
                                </p>
                            </div>
                            <div style="display:none" id="EditDiv1">
                                <p>
                                 <asp:TextBox ID="txtEdit" runat="server" class="edit_textarea" TextMode="MultiLine" ></asp:TextBox>
                               </p>
                                <p>
                                    <input type="button" value="确定" onclick="disPlayDIV()" />
                                    <asp:HyperLink ID="HyperLink3" runat="server">确定1</asp:HyperLink></p>
                            </div>
                        </div>
                        <div class="rili_view">
                            <%# ConvertToDate(Eval("CreateDate").ToString())%>
                        </div>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
        <span class="view_more">
            <asp:Button ID="btnPage" ToolTip="" runat="server" Text="显示更多" OnClick="btnPage_Click" /></a></span>
    </div>

    <script type="text/javascript">
        function display() {
            var rowTest = document.getElementById("rowTest");
            var rowTest1 = document.getElementById("rowTest1");
            switch (document.form1.chkChangeDirectionLink.checked) {
                case false:
                    document.form1.text.disabled = true;
                    rowTest.style.display = "block";
                    rowTest1.style.display = "block";
                    document.form1.text.value = "";
                    break;
                case true:
                    document.form1.text.disabled = false;
                    rowTest.style.display = "none";
                    rowTest1.style.display = "none";
                    document.form1.text.value = "";
                    break;
            }
        }
        
         function picUpdlad()
         {
          
         }
    </script>

    <script type="text/javascript">
    
        function nTabs(thisObj, Num) {
            if (thisObj.className == "active") return;
            var tabObj = thisObj.parentNode.id;
            var tabList = document.getElementById(tabObj).getElementsByTagName("li");
            for (i = 0; i < tabList.length; i++) {
                if (i == Num) {
                    thisObj.className = "curr";
                    document.getElementById(tabObj + "_Content" + i).style.display = "block";
                } else {
                    tabList[i].className = "normal";
                    document.getElementById(tabObj + "_Content" + i).style.display = "none";
                }
            }
        }
    </script>

</asp:Content>
